#ifndef _H_I_TO_SERVICE_RESOLVER_MSG_H_
#define _H_I_TO_SERVICE_RESOLVER_MSG_H_

#include "../typedefine.h"
#include "IServiceMsg.h"
#include "EServiceMsgType.h"
#include "SServiceFrontendID.h"
#include "../promise.h"

namespace QWER
{
	QCLASS IServiceBackend;
	QCLASS IServiceFrontend;
	QCLASS IService;
	template<typename T> class CPromise;

	QDLL_EXPORT QCLASS IToServiceBackendMsg QABSTRACT : public IServiceMsg
	{
	public:
		virtual EServiceMsgType GetMsgType() QCONST_FUNC QOVERRIDE
		{
			return EServiceMsgType::ToResolverMsg;
		}

	protected:
		virtual CPromise<BOOLN>* _OnRecv() QOVERRIDE;
		virtual CPromise<BOOLN>* _OnCall(PTR_OR_REF(IServiceBackend) roResolver, CONST_REF(SServiceFrontendID) rsAdapterID) = 0;

#ifdef _USING_CLI
	internal:
#else
	private:
		friend class CServiceFrontendHelper;
#endif
		SServiceFrontendID m_sFrontendID;
		IService* m_poService = NULL_PTR;
	};
}

#endif
